package com.huangfu.easysardine.gate.rpc;

import com.huangfu.easysardine.common.vo.authority.PermissionInfo;
import com.huangfu.easysardine.common.vo.user.UserInfo;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import java.util.List;


/**
 * Created with IntelliJ IDEA.
 * User: huangfu.daohui
 * Date: 2017-8-14
 * Time: 13:45
 * Description:跨服务用户调用
 */
@FeignClient("admin-back")
@RequestMapping("api")
public interface IUserService {
    @RequestMapping(value = "/user/username/{username}", method = RequestMethod.GET)
    public UserInfo getUserByUsername(@PathVariable("username") String username);

    @RequestMapping(value = "/user/un/{username}/permissions", method = RequestMethod.GET)
    public List<PermissionInfo> getPermissionByUsername(@PathVariable("username") String username);

    @RequestMapping(value = "/permissions", method = RequestMethod.GET)
    List<PermissionInfo> getAllPermissionInfo();
}
